
package py.una.pol.raphapy.autoventas.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Rafael E. Benegas
 */
@Embeddable
public class PuntoPreventaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "cod_ven")
    private long codVen;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "num_line")
    private String numLine;

    public PuntoPreventaPK() {
    }

    public PuntoPreventaPK(long codVen, String numLine) {
        this.codVen = codVen;
        this.numLine = numLine;
    }

    public long getCodVen() {
        return codVen;
    }

    public void setCodVen(long codVen) {
        this.codVen = codVen;
    }

    public String getNumLine() {
        return numLine;
    }

    public void setNumLine(String numLine) {
        this.numLine = numLine;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) codVen;
        hash += (numLine != null ? numLine.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof PuntoPreventaPK)) {
            return false;
        }
        PuntoPreventaPK other = (PuntoPreventaPK) object;
        if (this.codVen != other.codVen) {
            return false;
        }
        if ((this.numLine == null && other.numLine != null) || (this.numLine != null && !this.numLine.equals(other.numLine))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.una.pol.raphapy.autoventas.model.PuntoPreventaPK[ codVen=" + codVen + ", numLine=" + numLine + " ]";
    }
    
}
